package ppa.application.main;

import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.Scanner;

import javax.swing.SwingUtilities;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import ppa.application.dom.XMLParser;

public class TestClass {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {

				// GameWindow gm = new GameWindow();
				// gm.setVisible(true);
				
				
				Map<Integer, File> map ;
				XMLParser p;
				try {
					p = new XMLParser();
					map= p.getFileList();
					int i;
					Scanner sc = new Scanner(System.in);
					do {
						System.out.println("Choose a game :");
						i = sc.nextInt();
					} while (!map.containsKey(i));
					System.out.println("You chose : " + map.get(i).getName().toString());

				} catch (SAXException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (ParserConfigurationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
				
				
				

			}
		});

	}
}
